import java.util.Scanner;

public class Study8 {

	public static void main(String[] args) {
		Scanner cr=new Scanner(System.in);
		System.out.println("请输入消费金额：");
		double money=cr.nextDouble();
		if(money<100) {
			System.out.println(money);
		}else if(money<500) {
			System.out.println(money*0.9);
		}else if(money<1000) {
			System.out.println(money*0.85);
		}else if(money<5000) {
			System.out.println(money*0.8);
		}
	}
}